package univer.oko.database.rmi.impl;

import java.util.Collections;
import java.util.Vector;

/**
 * Created by Sergey Kharlamov
 * Date: 28.03.2006
 * Time: 19:14:26
 */
public class StatusImpl extends ImplHelper {

    public StatusImpl(RMIImpl rmi) {
        super(rmi);
    }

    public Vector getStatuses() {
        Vector v = this.getVectorValue("select status_name from status");
        Collections.sort(v);
        return v;
    }

    public String getStatusName(int idStatus) {
        return this.getStringValue("SELECT STATus_Name from Status where id_Status=" + idStatus);
    }

    public Integer getStatusID(String statusName) {
        return this.getIntValue("SELECT id_Status from Status where status_Name='" + statusName + "'");
    }


}
